package com.mentaleye.dal.dao.mybatis;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.mentaleye.dal.dao.PermissionsRoleDao;
import com.mentaleye.dal.model.PermissionsRoleKey;
import com.mentaleye.dal.service.PermissionsRoleMapper;
@Repository
public class PermissionsRoleDaoImpl  extends BaseDao implements PermissionsRoleDao{

	
	@Autowired private PermissionsRoleMapper permissionsRoleMapper;
	@Override
	public boolean insertPermissionsRole(PermissionsRoleKey permissionsRole) {
		return getResultByInt(permissionsRoleMapper.insert(permissionsRole));
	}

	@Override
	public boolean updatePermissionsRole(PermissionsRoleKey permissionsRole) {
		return getResultByInt(permissionsRoleMapper.updateByExampleSelective(permissionsRole, null));
	}

	@Override
	public boolean deletePermissionsRole(Integer roleNo) {
		return getResultByInt(permissionsRoleMapper.deleteByRoleNo(roleNo));
	}


	@Override
	public List<PermissionsRoleKey> queryPermissionsRole(Integer roleId) {
		return permissionsRoleMapper.selectByRole(roleId);
	}


	@Override
	public boolean insertPermissionsRoleList(List<PermissionsRoleKey> listBean) {
		return getResultByInt(permissionsRoleMapper.insertList(listBean));
	}

}
